<template>
	<view>
		<view class="box-list">
				
			<block v-for="(item, index ) in box_list">
				<view class="item">
				
					<navigator class="img" v-bind:url="'/sm_shop/pages/box/single?id='+item.id">
						<image mode="widthFix" v-bind:src="item.image" alt="" />
					</navigator>
					<navigator>
						<text class="name">{{item.name}}</text>
					</navigator>
				
					<view class="price-buy">
						<view class="price">
							<text class="text">¥{{item.price}}</text>
						</view>
						<view class="buy" >
							销量:{{item.sale?item.sale:0}}
						</view>
				
					</view>
				</view>
			</block>
				
		</view>
		
	</view>
</template>

<script>
	const app = getApp();
	export default {
		data() {
			return {
				
				box_list:[]
			}
		},
		onLoad:function(){
			
			this.get_box_list();
		},
		
		methods: {
			
			get_box_list:function(){
				var t = this;
				var url = '&m=sm_shop_plugin_box&r=box.index';
				var data = {
					// status: params.status
				};
				
				app.globalData.request(url, data, "GET", res => {
				
					t.box_list = res.data;
				
				});
			}
		}
	}
</script>
<style lang="less">
	@import './box.less';
</style>

